package com.zhss.demo;

import java.util.concurrent.TimeUnit;

public class ThreadHelp {
    public static void print(String msg) {
        Thread thread = Thread.currentThread();
        String name = thread.getName();
        long id = thread.getId();
        long now = System.currentTimeMillis();
        System.err.println("log : thread name = " + name + "; id = " + id + "; now = " + now + "; msg = " + msg + ";\r\n");
    }

    public static void sleep(long howlong, TimeUnit timeUnit) {
        try {
            timeUnit.sleep(howlong);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
